package com.lz.behavior.vistor.ext;

import com.lz.behavior.vistor.Developor;
import com.lz.behavior.vistor.Manager;
import com.lz.behavior.vistor.Vistor;

/**
 * DepartmentHeadVisor..
 *
 * @author Lizhong
 * @date 2019/9/27
 */
public class DepartmentHeadVisor implements Vistor {
    @Override
    // 只关注数量
    public void visit(Manager company) {
        System.out.println("Manager "+company.getName()+":"+ company.getProduct());
    }

    // 只关注代码
    @Override
    public void visit(Developor company) {
        System.out.println("Developor "+company.getName()+":"+ company.getCodeLine());

    }
}
